package com.mojo.io.stream;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @author <a href="mailto:mojo_jj@163.com">Mojo</a>
 */
public class Writer01 {
    static FileWriter writer;

    public static void main(String[] args) throws IOException {
        write1();
    }

    private static void write1() {
        File file = new File("t:\\a.txt");
        try {
            writer = new FileWriter(file);
            writer.write("1中文1");
            writer.append('d');
        } catch (IOException e) {
            //e.printStackTrace();
            System.out.println(e.getMessage());
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }

        }
    }
}
